#pragma once
#include "stdafx.h"
#include "tree.h"
#include "grid.h"
#include <vector>
__interface IArtPlayer
{
	void Init(Color_t col, short IAlevel, Grid *grid);
	Color_t GetArtPlayerColor();
	short MakeBestMove();
	void MakeBestMoveTracer(std::vector<long> &maxweights, short maxindex);
};
class ArtPlayer : public IArtPlayer
{
//metodi pubblici
public:
	ArtPlayer ():m_nArtPlayerCol(BLACK),m_sDiffLevel(0),m_sGrid(NULL){}
	~ArtPlayer(){}
	virtual void    Init(Color_t col,short IAlevel,Grid *grid);
	virtual Color_t GetArtPlayerColor() {return m_nArtPlayerCol;}
	virtual short   MakeBestMove();
	virtual void MakeBestMoveTracer(std::vector<long> &maxweights, short maxindex);

	template<typename T> void  UpdateTree(    T &node, Color_t enNextCoinCol, int liv);
	template<typename T> long  EvalTreeWeight(T &node,int liv);

private:
	Tree m_pMoveTree;
	Color_t m_nArtPlayerCol;
	short   m_sDiffLevel;
	Grid    *m_sGrid;
};
